//
//  WBStatus.h
//  WeiBo
//
//  Created by wbs on 17/2/13.
//  Copyright © 2017年 xiaomaolv. All rights reserved.
//

#import <Foundation/Foundation.h>

#pragma mark - WBStatus

@class WBUser;
@class WBStatusPhoto;
@class WBLinkResult;

FOUNDATION_EXTERN NSString *const kWBLinkResultType;
FOUNDATION_EXTERN NSString *const kWBLinkText;

@interface WBStatus : NSObject

@property (nonatomic, copy) NSString *created_at; // 微博创建时间
@property (nonatomic, copy) NSString *idstr; // 字符串型的微博ID
@property (nonatomic, copy) NSNumber *idNum; // 微博ID
@property (nonatomic, copy) NSString *text; // 微博信息内容
@property (nonatomic, copy) NSString *source; // 微博来源

@property (nonatomic, strong) WBUser *user; // 微博作者的用户信息字段
@property (nonatomic, strong) WBStatus *retweeted_status;

@property (nonatomic, copy) NSNumber *reposts_count; // 转发数
@property (nonatomic, copy) NSNumber *comments_count; // 评论数
@property (nonatomic, copy) NSNumber *attitudes_count; // 表态数

@property (nonatomic, strong) NSArray<WBStatusPhoto *> *pic_urls;

/// 微博信息图文混排内容
@property (nonatomic, copy) NSAttributedString *attributeText;
/// 存放所有链接模型
@property (nonatomic, strong) NSArray<WBLinkResult *> *linkResults;

@property (nonatomic, assign, getter = isRetweeted) BOOL retweeted;

@end


#pragma mark - WBRegexResult

@interface WBRegexResult : NSObject

@property (nonatomic, copy) NSString *string;
@property (nonatomic, assign) NSRange range;
@property (nonatomic, assign, getter = isEmotion) BOOL emotion;

@end


#pragma mark - WBLinkResult

typedef enum : NSUInteger {
    WBLinkResultType_Trend = 1,
    WBLinkResultType_At,
    WBLinkResultType_Link
} WBLinkResultType;

@interface WBLinkResult : NSObject

@property (nonatomic, copy) NSString *string;
@property (nonatomic, assign) NSRange range;
@property (nonatomic, assign) WBLinkResultType linkResultType;

+ (__kindof WBLinkResult *)linkResultWithString:(NSString *)string range:(NSRange)range linkResultType:(WBLinkResultType)linkResultType;
- (__kindof WBLinkResult *)initWithString:(NSString *)string range:(NSRange)range linkResultType:(WBLinkResultType)linkResultType;

@end


#pragma mark - WBVisialLink

@interface WBVisialLink : NSObject

@property (nonatomic, strong) WBLinkResult *linkResult;
@property (nonatomic, strong) NSArray<NSValue *> *rects;

@end

